#include "gtest/gtest.h"

#include <chrono>

TEST(ChronoTest, testSteadyClock){
    ASSERT_TRUE(std::chrono::steady_clock::is_steady);
    
    auto start = std::chrono::steady_clock::now();
    int sum = 0;
    for(long long  i = 0; i < 1000*1000; i++){
        sum += 100;
    }
    std::chrono::duration<double> ts = std::chrono::steady_clock::now() - start;
    ASSERT_TRUE(ts.count() < 0.1);

    std::chrono::steady_clock::time_point epoch;
    ASSERT_EQ(0, epoch.time_since_epoch().count());
}

TEST(ChronoTest, testSystemClock){
    ASSERT_FALSE(std::chrono::system_clock::is_steady);

    auto start = std::chrono::system_clock::now();
    int sum = 0;
    for(long long  i = 0; i < 1000*1000; i++){
        sum += 100;
    }
    std::chrono::duration<double> ts = std::chrono::system_clock::now() - start;
    ASSERT_TRUE(ts.count() < 0.1);
}


TEST(ChronoTest, testDurationCast){
//TODO:
}
